<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="p" uri="/WEB-INF/tld/page.tld" %>
<div class="block large-margin-bottom">
	<div class="block-title">
		<h3>学生列表</h3>
	</div>
	<div id="student-table-div">
		<table class="table responsive-table" id="sorting-example1">
			<thead>
				<tr>
					<th scope="col">用户名</th>
					<th scope="col">性别</th>
					<th scope="col">电话</th>
					<th scope="col">邮箱</th>
					<th scope="col">年级</th>
					<th scope="col">专业</th>
					<th scope="col">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${studentPage.list }" var="student">
					<tr>
						<td>${student.username }</td>
						<td>${student.sex_display }</td>
						<td>${student.tel }</td>
						<td>${student.email }</td>
						<td>${student.grade_display }</td>
						<td>${student.major_display }</td>
						<td>
							<span class="button-group compact">
								<a href="javascript:;" class="button" onclick='viewUser("${student.id}", "${student.type }")'>查看</a>
								<a href="javascript:;" class="button" onclick='delStudent("${student.id}")'>删除</a>
							</span>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		
		</table>
		
		<div class="dataTables_footer">
			<div class="dataTables_info" id="sorting-advanced_info">
				第${studentPage.pageNumber }/${studentPage.totalPage }页,共${studentPage.totalRow }条记录
			</div>
			<p:page totalRow="${studentPage.totalRow }" pageNumber="${studentPage.pageNumber }"
				 totalPage="${studentPage.totalPage }"></p:page>
		</div>
	</div>
</div>